#!/bin/sh
docker run -d --name kafka-server --hostname 172.16.60.234 \
    -p 9092:9092 \
    -p 9093:9093 \
    -e KAFKA_CFG_NODE_ID=0 \
    -e KAFKA_CFG_PROCESS_ROLES=controller,broker \
    -e KAFKA_CFG_CONTROLLER_QUORUM_VOTERS=0@172.16.60.234:9093 \
    -e KAFKA_CFG_LISTENERS=SASL_PLAINTEXT://:9092,CONTROLLER://:9093 \
    -e KAFKA_CFG_ADVERTISED_LISTENERS=SASL_PLAINTEXT://172.16.60.234:9092 \
    -e KAFKA_CLIENT_LISTENER_NAME=SASL_PLAINTEXT \
    -e KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,SASL_PLAINTEXT:SASL_PLAINTEXT \
    -e KAFKA_CLIENT_USERS=kafka \
    -e KAFKA_CLIENT_PASSWORDS=kafka@2024#! \
    -e KAFKA_CFG_CONTROLLER_LISTENER_NAMES=CONTROLLER \
    -e KAFKA_CFG_SASL_MECHANISM_CONTROLLER_PROTOCOL=PLAIN \
    -e KAFKA_CONTROLLER_USER=kafka \
    -e KAFKA_CONTROLLER_PASSWORD=kafka@2024#! \
    -e KAFKA_CFG_INTER_BROKER_LISTENER_NAME=SASL_PLAINTEXT \
    -e KAFKA_CFG_SASL_MECHANISM_INTER_BROKER_PROTOCOL=PLAIN \
    -e KAFKA_INTER_BROKER_USER=kafka \
    -e KAFKA_INTER_BROKER_PASSWORD=kafka@2024#!  bitnami/kafka:latest
